// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

namespace vespalib { class IFieldBase; }

namespace search {
namespace expression {

class RawResultNode;
class ResultNodeVector;
class ResultNode;

class ResultSerializer
{
public:
    virtual ~ResultSerializer() { }
    virtual ResultSerializer & putResult(const vespalib::IFieldBase & field, const RawResultNode & value) = 0;
    virtual ResultSerializer & putResult(const vespalib::IFieldBase & field, const ResultNodeVector & value) = 0;
    virtual void proxyPut(const ResultNode & value) = 0;
};

class ResultDeserializer
{
public:
    virtual ~ResultDeserializer() { }
    virtual ResultDeserializer & getResult(const vespalib::IFieldBase & field, RawResultNode & value) = 0;
    virtual ResultDeserializer & getResult(const vespalib::IFieldBase & field, ResultNodeVector & value) = 0;
    virtual void proxyGet(const ResultNode & value) = 0;
};

}
}

